import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: '/usertable',
    name: 'userTable',
    component: () => import('../views/UserTable.vue'),
  },
  {
    path: "/",
    name: "home",
    component: HomeView,
  },
  {
    path: "/rich_text",
    name: "RichText",
    component: () =>
      import("../views/RichText.vue"),
  },
  {
    path: "/answering",
    name: "answering",
    component: () =>
      import("../views/AnSwering.vue"),
  },
  {
    path: "/news_list",
    name: "NewsList",
    component: () =>
      import("../views/NewsList.vue"),
  },
  {
    path: "/news_modify/:id",
    props: true,
    name: "NewsModify",
    component: () =>
      import("../views/NewsModify.vue"),
  },
  {
    path: "/clinic",
    name: "clinic",
    component: () =>
      import("../views/ClinicView.vue"),
  },
  {
    path: '/clinicDetails',
    name: 'clinicDetails',
    component: () =>
      import('../views/ClinicDetails.vue'),
  },
  {
    path: '/registration',
    name: 'registration',
    component: () =>
      import('../views/Registration.vue'),
  },
  {
    path: "/doctorManage",
    name: "doctorManage",
    component: () =>
      import("../views/doctorList"),
    redirect: "/doctorManage/list",
    children: [{
      path: "list",
      component: () =>
        import("../views/doctorList/list/index.vue"),
    },
    {
      path: "add",
      component: () =>
        import("../views/doctorList/add_doctor/index.vue"),
    },
    {
      path: "edit/:id",
      name: "editDoctorList",
      component: () =>
        import("../views/doctorList/edit_doctor/index.vue"),
    },
    ],
  },

    //智慧大屏
    {
      path: '/iframe',
      name: 'iframe',
      component: ()=>import('../views/iframe.vue')
    },
];

const router = new VueRouter({
  // base: '/aier_admin/',
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router;